package com.sc1905.crane.reading.service.impl;

import com.sc1905.crane.mapper.NBookshelfMapper;
import com.sc1905.crane.pojo.NBookshelf;
import com.sc1905.crane.reading.service.BookShelfService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
public class BookShelfServiceImpl implements BookShelfService {

    @Resource
    NBookshelfMapper bookshelfMapper;

    @Override
    public int AddBookShelf(NBookshelf bookshelf) {
        return bookshelfMapper.insertSelective(bookshelf);
    }

    @Override
    public NBookshelf isHaveHistory(Integer novelId) {
        return bookshelfMapper.isHaveHistory(novelId);
    }

    @Override
    public int deleteBookShelf(Integer userId, Integer novelId) {
        return bookshelfMapper.deleteBookShelf(userId,novelId);
    }
}
